package com.example.charset;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class CharSetDemo2 {
    public static void main(String[] args) throws IOException {

        /**
         * 字节流拷贝中文文件(无乱码)
         */

        FileInputStream fis = new FileInputStream("src/com/example/file/c.txt");
        FileOutputStream fos = new FileOutputStream("src/com/example/file/d.txt");

        int read = fis.read();
        while (read != -1) {
            fos.write(read);
            read = fis.read();
        }

        fos.close();
        fis.close();

    }
}
